// import statements
//update matt 1
//update jordan 2
//update Ray 1
import java.awt.Component;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.*;
import java.util.Timer;

import javax.swing.*;

//Test 2 Jordan
//Test 1 Matt
//Test 1 Ray

public class Main  {
    


    private static Menu menuSystem;  // stores the Casual Employee object
    private static  View viewSystem;
    private static Model modelSystem;
    private static Controller controllerSystem;
    public static JFrame globalFrame = Global.globalFrame;
    public static JPanel globalPanel;
    public static Timer timer;
    
    //public static AITimer globalTimer;
    
    
    public Main() throws IOException  {
        
        menuSystem = new Menu();
        viewSystem = new View();
        modelSystem = new Model();
       // globalFrame = new JFrame();
        globalPanel = new JPanel();
        controllerSystem = new Controller(false,new int[2], new int[2]);
        //globalTimer = new AITimer();
        timer = new Timer();
        timer.scheduleAtFixedRate(new AITimer(), 5000, 3000);
        
    } 
    
    public static JFrame getGlobalFrame()
    {
    	return globalFrame;
    }
   
    
    public static JPanel getGlobalPanel()
    {
    	return globalPanel;
    }
    
    public void runMain(){
        //call to run setMenuBar() is in View
        //wont add to frame otherwise..needs to
        //be fixed possibly!?!?
        //menuSystem.setMenuBar();
        
        //As of now we have to manually call 
        //each function of viewSystem
        //can create logic in Controller 
        //to call different functions to
        //show different frames.
        
        //show setLoadGame() every time
        viewSystem.setGameMenu(true, globalFrame);
        //Create logic to display setPVPGameBoard();
        //99% positive you will have to disable 
        //setLoadGame() when this is called.
        //viewSystem.setPVPGameBoard(true, globalFrame);
        
        
    }
    public static void main(String[] args) throws IOException  {
        Main mySystem = new Main();
        mySystem.runMain();
    }  // end main
        
        
    public static Menu getMenuSystem() {
        return menuSystem;
    }

    public static void setMenuSystem(Menu menuSystem) {
        //this.menuSystem = menuSystem;
        Main.menuSystem =menuSystem;
    }

    public static View getViewSystem() {
        return viewSystem;
    }

    public static void setViewSystem(View viewSystem) {
        Main.viewSystem = viewSystem;
    }

    public static Model getModelSystem() {
        return modelSystem;
    }

    public static void setModelSystem(Model modelSystem) {
        Main.modelSystem = modelSystem;
    }

    public static Controller getControllerSystem() {
        return controllerSystem;
    }    
    
    public void setControllerSystem(Controller controllerSystem) {
        this.controllerSystem = controllerSystem;
    }    

}  // end Class PayrollSystem